package thn.home.glf.kotoba;

import java.util.List;

import thn.home.glf.kotoba.database.BaiDB;
import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class LessonAdapter extends  ArrayAdapter<BaiDB>{
	private  Activity context;
	private List<BaiDB> list;
	public TextView txtbaiitem;
	public LessonAdapter(Activity context,List<BaiDB> list){
		super(context,R.layout.rowbai,list);
		this.context=context;
		this.list=list;
	}
	@Override
	public View getView(int position, View convertView, ViewGroup parent){
		View view = convertView;
		
		LayoutInflater inflator = context.getLayoutInflater();
		if (null == view) {
			view = inflator.inflate(R.layout.rowbai, null);
		} else {
			view = convertView;
		}
		
		txtbaiitem=(TextView)view.findViewById(R.id.txtbaiitem);
		txtbaiitem.setText(this.list.get(position).getNames());
		return view;
	}
}
